import request from './index'
export const cateListAPI = params => request({
  method: 'GET',
  url: 'categories',
  params
})

export const addCateListAPI = data => request({
  method: 'POST',
  url: 'categories',
  data
})

export const paramsListAPI = (id, params) => request({
  method: 'GET',
  url: `categories/${id}/attributes`,
  params
})

export const paramsAddAPI = (id, data) => request({
  method: 'POST',
  url: `categories/${id}/attributes`,
  data
})

export const paramsEditAPI = (id, attrId, params) => request({
  method: 'GET',
  url: `categories/${id}/attributes/${attrId}`,
  params
})

export const EditAPI = (id, attrId, data) => request({
  method: 'PUT',
  url: `categories/${id}/attributes/${attrId}`,
  data
})

export const deleteAPI = (id, attrId) => request({
  method: 'DELETE',
  url: `categories/${id}/attributes/${attrId}`
})
